<script lang="ts" setup>
	import { computed } from 'vue';

	const props = withDefaults(defineProps<{ span ?: number }>(), {
		span: 0
	})

	const className = computed(() => {
		const map = { 'um-col': true }
		map['um-col-' + props.span] = true
		return map
	})
</script>

<template>
	<view :class="className">
		<slot></slot>
	</view>
</template>

<style lang="scss" scoped>
	@use "sass:math";

	.um-col {
		float: left;
		box-sizing: border-box;
	}

	@for $i from 1 through 24 {
		.um-col-#{$i} {
			width: (math.div($i, 24) * 100%);
		}
	}
</style>